const App = getApp()
Component({
  /**
   * 组件的属性列表
   */
  externalClasses: ['ex-class'],
  options: {
    multipleSlots: true
  },
  properties: {
    list: Array,
    total: Number,
    pretotal: Number,
    currentIndex: {
      type: Number,
      value: 1
    }
  },
  /**
   * 组件的初始数据
   */
  data: {},
  /**
   * 组件的方法列表
   */
  methods: {
    //tab切换
    onChange: function(e) {
      // params.order = n.sort === 1 ? 'asc' : 'desc'
      var type = e.currentTarget.dataset.type
      console.log(type)


      if (type == 'price') {

      }else if(type == 'discount'){

      }
      this.setData({
        currentIndex: type
      })
      // 触发请求数据
      this.triggerEvent('fetch', type)
    },
    // 分享
    doShare(e) {
      this.triggerEvent('share', e.detail)
    },
    // 绑定手机
    doSubscribe() {
      this.triggerEvent('subscribe')
    }
  }
})
